home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- from base.g import *
- from base import device
- from prnt import cups
- from ui_utils import *
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
- from printsettingsdialog_base import Ui_Dialog
- from printsettingstoolbox import PrintSettingsToolbox
- from printernamecombobox import PRINTERNAMECOMBOBOX_TYPE_PRINTER_AND_FAX, PRINTERNAMECOMBOBOX_TYPE_FAX_ONLY
-
- class PrintSettingsDialog(QDialog, Ui_Dialog):
-
- def __init__(self, parent, printer_name, fax_mode = False):
- QDialog.__init__(self, parent)
- self.setupUi(self)
- self.fax_mode = fax_mode
- self.printer_name = printer_name
- self.device_uri = None
- self.devices = { }
- self.printer_index = { }
- self.user_settings = UserSettings()
- self.user_settings.load()
- self.user_settings.debug()
- self.initUi(printer_name)
- QTimer.singleShot(0, self.updateUi)
-
-
- def initUi(self, printer_name = None):
- self.OptionsToolBox.include_print_options = False
- if self.printer_name:
- self.PrinterName.setInitialPrinter(self.printer_name)
-
- if self.fax_mode:
- self.PrinterName.setType(PRINTERNAMECOMBOBOX_TYPE_FAX_ONLY)
- self.TitleLabel.setText(self._PrintSettingsDialog__tr('Fax Settings'))
- else:
- self.PrinterName.setType(PRINTERNAMECOMBOBOX_TYPE_PRINTER_AND_FAX)
- self.connect(self.CloseButton, SIGNAL('clicked()'), self.CloseButton_clicked)
- self.connect(self.PrinterName, SIGNAL('PrinterNameComboBox_currentChanged'), self.PrinterNameComboBox_currentChanged)
- self.connect(self.PrinterName, SIGNAL('PrinterNameComboBox_noPrinters'), self.PrinterNameComboBox_noPrinters)
- self.setWindowIcon(QIcon(load_pixmap('hp_logo', '128x128')))
-
-
- def updateUi(self):
- self.PrinterName.updateUi()
-
-
- def PrinterNameComboBox_noPrinters(self):
- FailureUI(self, self._PrintSettingsDialog__tr('<b>No printers or faxes found.</b><p>Please setup a printer or fax and try again.'))
- self.close()
-
-
- def PrinterNameComboBox_currentChanged(self, device_uri, printer_name):
- self.printer_name = printer_name
- self.device_uri = device_uri
-
- try:
- self.devices[device_uri]
- except KeyError:
- self.devices[device_uri] = device.Device(device_uri)
-
- self.OptionsToolBox.updateUi(self.devices[device_uri], self.printer_name)
-
-
- def CloseButton_clicked(self):
- self.close()
-
-
- def __tr(self, s, c = None):
- return qApp.translate('PrintSettingsDialog', s, c)
-
-
-